package com.example.dong.clients.fallback;


import com.example.dong.clients.SomethingClient;
import com.example.dong.clients.factory.FeignClientFallbackProxyFactory;
import feign.hystrix.FallbackFactory;

/**
 * fallbackFactory
 * @author dzh
 * @date 2022/12/9 15:24
 */
public class SomeClientFallbackFactory implements FallbackFactory<SomethingClient> {

    @Override
    public SomethingClient create(Throwable cause) {
        // 使用动态代理处理fallback通用逻辑
        return FeignClientFallbackProxyFactory.createFallbackProxy(SomethingClient.class, cause);
    }
}
